import { onMounted, ref } from 'vue'
export default function () {
  //现在声明的变量还不具备双向绑定。添加ref函数才能具备响应式
  const userName = ref('王⼀')
  const salary = ref(15000)
  function addSalary() {
    salary.value += 1000
    console.log('salary = ' + salary.value)
  }
  onMounted(() => {
    console.log('加载了外部脚本')
  })
  return { userName, salary, addSalary }
}
